<%@page import="bean.B01boardDTO"%>
<%@page import="bean.B01boardVO" %>
<%@page import="java.util.ArrayList" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>List</title>
<link rel="stylesheet" href="./css/B01board.css">
<script src = './js/B01board.js'></script>
</head>
<body>
<jsp:useBean id="vo" class="bean.B01boardVO" scope="page"/>
<jsp:setProperty property="*" name="vo"/>
<%
B01boardDTO dto = new B01boardDTO();
dto.setVo(vo);
ArrayList<B01boardVO> al = dto.select();
%>



<div id = 'wrap1' align="center" style="font-size: small;">
	<form name = 'hiddenFrm' method='post' >
		 	<input type='hidden' name="nowPage">
		 	<input type='hidden' name='find'>
		 	<input type='hidden' name='b_number'>
		 	<input type="hidden" name="b_content">
	</form>


	<div id = 'wrap' align="center">
	<h1 id="title" align="center" style="color: #0080ff;">제품후기 게시판</h1>
    	<div class = 'list_title'>
		<div id='list_b_photo'>이미지</div>
		<div id='list_b_title'>상품명</div>
		<div id='list_content'>내용</div>
		<div id='list_writter'>작성자</div>
		<div id='list_wdate'>작성일</div>
		<div id='list_b_review'>HIT</div>
	</div>
<div id="title_boardLine"></div>	
<%
	for(int a=0; a<al.size(); a++){ B01boardVO v = al.get(a);
%>
 <div class="list_items">
 
 		<div id='list_b_photo' ><a href = '#'style="text-decoration:none"  onclick="<%if(session.getAttribute("sessionMid") == null || session.getAttribute("sessionMid").equals("")){%>
 					gologin(<%=dto.getNowPage()%>,<%=v.getB_number()%>)">
 					<%if(v.getB_prno() ==1) {%>
 							<img src="/kiSunnyShop/thumb_B/<%=v.getB_image()%>" class="img"></a>
 						<%}else{ %>
 							&nbsp;&nbsp;&nbsp;
								└>  <img src="/kiSunnyShop/thumb_B/<%=v.getB_image()%>" class="img"></a>
 					<%} %>
 		   <%}else{%>
 		   			goView(<%=dto.getNowPage()%>,<%=v.getB_number()%>)">
						<%if(v.getB_prno() ==1) {%>
 							<img src="/kiSunnyShop/thumb_B/<%=v.getB_image()%>" class="img"></a>
 						<%}else{ %>
 							&nbsp;&nbsp;&nbsp;
							└>	<img src="/kiSunnyShop/thumb_B/<%=v.getB_image()%>" class="img"></a>
 					<%} %>
 		   <%}%>	
		</div>
		<div id='list_b_title' align='center'><%=v.getB_title()%></div>
		<div id='list_content'>
			<a href = '#' style="text-decoration:none" onclick="<%if(session.getAttribute("sessionMid") == null || session.getAttribute("sessionMid").equals("")){%>
										gologin(<%=dto.getNowPage()%>,<%=v.getB_number()%>)">
										<%if(v.getB_prno() ==1){ %>
										<%=v.getB_content()%>==<%=v.getB_prno() %>
										<%}else{ %>
											&nbsp;&nbsp;&nbsp;
											└>	<%=v.getB_content()%>==<%=v.getB_prno() %>
										<%} %>
									<%}else{%>
								   		goView(<%=dto.getNowPage()%>,<%=v.getB_number()%>)">		
								   		<%if(v.getB_prno() ==1){ %>
											<%=v.getB_content()%>==<%=v.getB_prno() %>
										<%}else{ %>
											&nbsp;&nbsp;&nbsp;
											└>	<%=v.getB_content()%>==<%=v.getB_prno() %>
										<%} %>
								   <%}%>	
			</a>
		</div>
		<div id='list_writter'><%=v.getM_id()%></div>
		<div id='list_wdate'><%=v.getB_date()%></div>
		<div id='list_b_review'><%=v.getChe()%></div>
		</div>
<!-- 		<div id='list_b_image'>	 -->
			
<%-- 		<% if(v.getB_image()!= null){%>	 --%>
<%-- 			 <% if(v.getB_image().length()>15){ --%>
<%-- 				String image = v.getB_image().substring(0, 15); %> --%>
<%-- 		    	<%=image%>.. --%>
<%-- 			<%}else{%> --%>
<%-- 				<%=v.getB_image()%>  --%>
<%-- 			<%}%>	 --%>
<%-- 		<%}else{%> --%>
<!-- 			파일없음 -->
<%-- 		<%}%> --%>
<%}%>	
</div>	
</p>

<!-- 페이지  -->
<div id = 'list_page' align="center">
		<% if(dto.getNowPage()==1){%>
		[처음으로]
		<%}else{%><a href='#' onclick='goPage(1)'>[처음으로]  </a>
		<%}%>
		
	<% if(dto.getNowBlock()==1){%>
		[이전으로]
		<%}else{%><a href="#" onclick='goPage(<%=dto.getStartPage()-1 %>)'>[이전으로]</a>
		<%} %>	
	<%	
	int i=0;
	for(i = dto.getStartPage(); i<=dto.getEndPage(); i++){%>
	<a href= "#" onclick = "goPage(<%= i %>)"><%= i %></a>
	<%} %>
	<% if(dto.getNowBlock()==dto.getTotBlock()){%>
		[다음으로]
		<%}else{%><a href= '#' onclick = "goPage(<%=i %>)">  [다음으로]</a>
		<%} %>
	
	<% if(dto.getNowPage()==dto.getTotPage()){%>
		[맨끝으로]
		<%}else{%><a href= "#" onclick = "goPage(<%=dto.getTotPage() %>)">  [맨끝으로]</a>
		<%} %>	
	
</div>
	<p/>
	<div align="center"> 
		<form action="index1.jsp?inc=./Community/list.jsp" name ='board_list_frm' method = 'post'>
			<input type="text" name = 'find' value ="<%=vo.getFind()%>" size="60"/>
			<input type="submit" value='검색'>
		
	
	<%if(session.getAttribute("sessionMid") == null || session.getAttribute("sessionMid").equals("") ){ %>
		<input type="button" value="새 글쓰기" id="btnNotInput" style="margin-right: 1000px;">
	<%}else{ %>
		<input type="button" value="새 글쓰기" id="btnInput"/>
	<%} %>
	</div>
	</form>
	<p/>
	<hr id="title_boardLine" style="border-color: #0080ff;"/>
</div>	
</body>
<script>listInit();</script>
</html>